package com.sailfish.springbootdemo.dao.db8;

import com.sailfish.springbootdemo.common.DB8TableName;
import com.sailfish.springbootdemo.pojo.db8.IntfFromVplWebPackage;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface IntfFromVplWebPackageDao {

    @Insert("<script>" +
            "insert into " + DB8TableName.INTF_FROM_VPLWEB_PACKAGE + " " +
            "( "+
            "GUID, " +
            "pkg_name, " +
            "is_size_not_fit, " +
            "is_grid_design, " +
            "is_special_design, " +
            "is_small_air_gap, " +
            "assembly_type, " +
            "foot_num, " +
            "is_dense_comp, " +
            "pastemask_thickness_min, " +
            "pastemask_thickness_max, " +
            "pin_min_pitch, " +
            "body_length, " +
            "body_width, " +
            "pitch_o2c_x, " +
            "pitch_o2c_y, " +
            "pad_airgap_min, " +
            "creator " +
            ")"+
            "values "+
            "<foreach collection=\"entities\" item=\"entity\" separator=\",\">" +
            "(" +
            "#{entity.GUID}, " +
            "#{entity.pkg_name}, " +
            "#{entity.is_size_not_fit}, " +
            "#{entity.is_grid_design}, " +
            "#{entity.is_special_design}, " +
            "#{entity.is_small_air_gap}, " +
            "#{entity.assembly_type}, " +
            "#{entity.foot_num}, " +
            "#{entity.is_dense_comp}, " +
            "#{entity.pastemask_thickness_min}, " +
            "#{entity.pastemask_thickness_max}, " +
            "#{entity.pin_min_pitch}, " +
            "#{entity.body_length}, " +
            "#{entity.body_width}, " +
            "#{entity.pitch_o2c_x}, " +
            "#{entity.pitch_o2c_y}, " +
            "#{entity.pad_airgap_min}, " +
            "#{entity.creator} " +
            ")"+
            "</foreach>"+
            "</script>"
    )
    Integer insertIntfFromVplWebPackageBatch(@Param("entities") List<IntfFromVplWebPackage> entities);

}
